Heap Garbage Collection with Reference Counting

نویسندگان

  • Wuu Yang
  • Huei-Ru Tseng
  • Rong-Hong Jan
چکیده

In algorithms based on reference counting, a garbage-collection decision has to be made whenever a pointer x→ y is about to be destroyed. At this time, the node y may become dead even if y’s reference count is not zero. This is because y may belong to a piece of cyclic garbage. Some aggressive collection algorithms will put y on the list of potential garbage regardless of y’s reference count. Later a trace procedure starting from y will be initiated. Other algorithms, less aggressive, will put y on the list of potential garbage only if y’s reference count falls below a threshold, such as 3. The former approach may waste time on tracing live nodes and the latter may leave cyclic garbage uncollected indefinitely. The problem with the above two approaches (and with reference counting in general) is that it is difficult to decide if y is dead when the pointer x→ y is destroyed. We propose a new garbage-collection algorithm in which each node maintains two, rather than one, reference counters, gcount and hcount. Gcount is the number of references from the global variables and from the run-time stack. Hcount is the number of references from the heap. Our algorithm will put node y on the list of potential garbage if and only if y’s gcount becomes 0. The better prediction made by our algorithm results in more efficient garbage collectors.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Active Memory Processor: A Hardware Garbage Collector for Real-Time Java Embedded Devices

Java possesses many advantages for embedded system development, including fast product deployment, portability, security, and a small memory footprint. As Java makes inroads into the market for embedded systems, much effort is being invested in designing real-time garbage collectors. The proposed garbage-collected memory module, a bitmap-based processor with standard DRAM cells is introduced to...

متن کامل

Using Contaminated Garbage Collection and Reference Counting Garbage Collection to Provide Automatic Storage Reclamation for Real-Time Systems

USING CONTAMINATED GARBAGE COLLECTION AND REFERENCE COUNTING GARBAGE COLLECTION TO PROVIDE AUTOMATIC STORAGE RECLAMATION FOR REAL TIME SYSTEMS by Matthew P Hampton ADVISOR Dr Ron K Cytron May Saint Louis Missouri Language support for dynamic storage management simpli es the application programming task immensely As a result dynamic storage allocation and garbage collection have become common in...

متن کامل

Efficient Heap Management for Declarative Data Parallel Programming on Multicores

Declarative data parallel programming for shared memory multiprocessor systems implies paradigm-specific demands on the organisation of memory management. As a key feature of declarative programming implicit memory management is indispensable. Yet, the memory objects to be managed are very different from those that are predominant in general-purpose functional or object-oriented languages. Rath...

متن کامل

A Distributed Garbage Collection Algorithm

Concurrent Scheme extends the Scheme programming language, providing parallel program execution on a distributed network. The Concurrent Scheme environment requires a garbage collector to reclaim global objects; objects that exist in a portion of the global heap located on the node that created them. Because a global object may be referenced by several nodes, traditional garbage collection algo...

متن کامل

Uniprocessor Garbage Collection Techniques

We survey basic garbage collection algorithms and variations such as incremental and gen erational collection The basic algorithms include reference counting mark sweep mark compact copy ing and treadmill collection Incremental techniques can keep garbage collection pause times short by interleaving small amounts of collection work with program execution Generational schemes improve e ciency an...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010